import { Column, Entity, PrimaryColumn } from "typeorm";
import { ManualTimestamp } from "../decorators/manual-timestamp.decorator";

@Entity("equipment_base")
@ManualTimestamp()
export class EquipmentBaseEntity {
  @PrimaryColumn({ type: "int", comment: "装备ID" })
  id!: number;

  @Column({ type: "varchar", length: 100, comment: "装备名称" })
  name!: string;

  @Column({ type: "int", comment: "基础类型" })
  base!: number;

  @Column({ type: "int", comment: "等级" })
  level!: number;

  @Column({ type: "varchar", length: 20, comment: "价格" })
  price!: string;

  @Column({ type: "int", comment: "装备类型" })
  type!: number;

  @Column({ type: "varchar", length: 100, comment: "图片" })
  image!: string;

  @Column({ type: "text", nullable: true, comment: "介绍" })
  intro?: string;

  @Column({ type: "int", default: 0, comment: "重量" })
  weight!: number;

  @Column({ type: "int", default: 0, comment: "需求等级" })
  req_level!: number;

  @Column({ type: "int", default: 0, comment: "需求力量" })
  req_strength!: number;

  @Column({ type: "int", default: 0, comment: "需求体质" })
  req_constitution!: number;

  @Column({ type: "int", default: 0, comment: "需求敏捷" })
  req_agility!: number;

  @Column({ type: "int", default: 0, comment: "需求智力" })
  req_intelligence!: number;

  @Column({ type: "int", default: 0, comment: "攻击加成" })
  bonus_attack!: number;

  @Column({ type: "int", default: 0, comment: "血量加成" })
  bonus_hp!: number;

  @Column({ type: "int", default: 0, comment: "魔法加成" })
  bonus_mp!: number;

  @Column({ type: "int", default: 0, comment: "防御加成" })
  bonus_defense!: number;

  @Column({ type: "varchar", length: 50, nullable: true, comment: "抗性类型" })
  resistance_type?: string;

  @Column({ type: "int", default: 0, comment: "抗性值" })
  resistance_value!: number;

  @Column("datetime", { name: "created_at", comment: "创建时间" })
  created_at!: Date;

  @Column("datetime", {
    name: "updated_at",
    nullable: true,
    comment: "更新时间",
  })
  updated_at!: Date | null;
}
